package com.chx.mapper;

import com.chx.annotation.AutoFill;
import com.chx.annotation.AutoFillOrder;
import com.chx.dto.SaleOrderPageQueryDto;
import com.chx.entity.SaleOrders;
import com.chx.enumeration.OperationType;
import com.github.pagehelper.Page;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

/**
 * @Author cp-月入过万
 * @Date 2025/5/30
 */
@Mapper
public interface SaleOrderMapper {
    @AutoFillOrder(OperationType.INSERT)
    void insert(SaleOrders saleOrders);

    @AutoFillOrder(OperationType.UPDATE)
    void update(SaleOrders saleOrders);

    @Select("select * from sale_orders where order_id = #{id}")
    SaleOrders getById(Long id);

    Page<SaleOrders> page(SaleOrderPageQueryDto saleOrderPageQueryDto);
}
